package Vista;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class Vtienda extends javax.swing.JFrame {
	private JPanel panContenedort;
	private JLabel jLabel1;
	private JTextField txtnombre;
	private JTextField txtdireccion;
	private JTextField txtcod_Tienda;
	private JLabel lblhorario;
	private JTextField txtemail;
	private JButton btnregistrar;
	private JLabel lblcod_tienda;
	private JButton btnsalir;
	private JLabel lbltitulo;
	private JLabel lblemail;
	private JTextField txthorario;
	private JLabel lbldireccion;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				Vtienda inst = new Vtienda();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public Vtienda() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				panContenedort = new JPanel();
				getContentPane().add(panContenedort, BorderLayout.CENTER);
				panContenedort.setLayout(null);
				panContenedort.setPreferredSize(new java.awt.Dimension(397, 370));
				{
					jLabel1 = new JLabel();
					panContenedort.add(jLabel1);
					jLabel1.setText("Nombre:");
					jLabel1.setBounds(68, 108, 62, 15);
				}
				{
					txtnombre = new JTextField();
					panContenedort.add(txtnombre);
					txtnombre.setBounds(183, 105, 122, 22);
				}
				{
					txtdireccion = new JTextField();
					panContenedort.add(txtdireccion);
					txtdireccion.setBounds(183, 148, 122, 22);
				}
				{
					lbldireccion = new JLabel();
					panContenedort.add(lbldireccion);
					lbldireccion.setText("Dirección");
					lbldireccion.setBounds(68, 151, 58, 15);
				}
				{
					lblhorario = new JLabel();
					panContenedort.add(lblhorario);
					lblhorario.setText("Horario Trabajo:");
					lblhorario.setBounds(68, 193, 103, 15);
				}
				{
					txthorario = new JTextField();
					panContenedort.add(txthorario);
					txthorario.setBounds(183, 190, 122, 22);
				}
				{
					lblemail = new JLabel();
					panContenedort.add(lblemail);
					lblemail.setText("Email");
					lblemail.setBounds(68, 235, 33, 15);
				}
				{
					txtemail = new JTextField();
					panContenedort.add(txtemail);
					txtemail.setBounds(183, 232, 122, 22);
				}
				{
					btnregistrar = new JButton();
					panContenedort.add(btnregistrar);
					btnregistrar.setText("Registrar");
					btnregistrar.setBounds(77, 304, 95, 34);
				}
				{
					lbltitulo = new JLabel();
					panContenedort.add(lbltitulo);
					lbltitulo.setText("Tienda");
					lbltitulo.setBounds(126, 25, 49, 15);
				}
				{
					btnsalir = new JButton();
					panContenedort.add(btnsalir);
					btnsalir.setText("Salir");
					btnsalir.setBounds(210, 304, 95, 34);
				}
				{
					lblcod_tienda = new JLabel();
					panContenedort.add(lblcod_tienda);
					lblcod_tienda.setText("Código:");
					lblcod_tienda.setBounds(68, 71, 47, 15);
				}
				{
					txtcod_Tienda = new JTextField();
					panContenedort.add(txtcod_Tienda);
					txtcod_Tienda.setBounds(183, 68, 122, 22);
				}

			}
			pack();
			this.setSize(400, 400);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

	
	public String getNombre() {
		return txtnombre.getText();
	}

	
	public String getDireccion() {
		return txtdireccion.getText();
	}

	
	public String getCodTienda() {
		return txtcod_Tienda.getText();
	}

	
	public String getEmail() {
		return txtemail.getText();
	}

	
	public String getHorario() {
		return txthorario.getText();
	}

	
	public void agregarListener(ActionListener accion){
		btnregistrar.addActionListener(accion);
		btnsalir.addActionListener(accion);
		}
	
	public void blanquearCampos() {
		txtnombre.setText("");
		txtdireccion.setText("");
		txthorario.setText("");
		txtemail.setText("");
	}	
	
}
